<?php
/**
 * Magento
 *
 * NOTICE OF LICENSE
 *
 * This source file is subject to the Academic Free License (AFL 3.0)
 * that is bundled with this package in the file LICENSE_AFL.txt.
 * It is also available through the world-wide-web at this URL:
 * http://opensource.org/licenses/afl-3.0.php
 * If you did not receive a copy of the license and are unable to
 * obtain it through the world-wide-web, please send an email
 * to license@magentocommerce.com so we can send you a copy immediately.
 *
 * DISCLAIMER
 *
 * Do not edit or add to this file if you wish to upgrade Magento to newer
 * versions in the future. If you wish to customize Magento for your
 * needs please refer to http://www.magentocommerce.com for more information.
 *
 * @category   design_blank
 * @package    Mage
 * @copyright  Copyright (c) 2008 Irubin Consulting Inc. DBA Varien (http://www.varien.com)
 * @license    http://opensource.org/licenses/afl-3.0.php  Academic Free License (AFL 3.0)
 */
?>
<div class="block block-compare">
    <div class="block-title">
        <?php if($this->helper('catalog/product_compare')->getItemCount()>0): ?>
            <h2><?php echo $this->__('Compare Products - %d Items', $this->helper('catalog/product_compare')->getItemCount()) ?></h2>
        <?php else: ?>
            <h2><?php echo $this->__('Compare Products') ?></h2>
        <?php endif; ?>
    </div>
    <div class="block-content">
    <?php if($this->helper('catalog/product_compare')->getItemCount()>0): ?>
        <ol id="compare-items">
        <?php foreach($this->helper('catalog/product_compare')->getItemCollection() as $_index=>$_item): ?>
            <li>
                <input type="hidden" class="compare-item-id" value="<?php echo $_item->getId() ?>" />
                <a href="<?php echo $this->helper('catalog/product_compare')->getRemoveUrl($_item) ?>"><img src="<?php echo $this->getSkinUrl('images/list_remove_btn.gif') ?>" alt="<?php echo $this->__('Remove This Item') ?>" title="<?php echo $this->__('Remove This Item') ?>" class="v-middle" onclick="return confirm('<?php echo $this->__('Are you sure you would like to remove this item from the compare products?') ?>');" /></a>
                <a href="<?php echo $_item->getProductUrl() ?>"><?php echo $this->htmlEscape($_item->getName()) ?></a>
            </li>
        <?php endforeach; ?>
        </ol>
        <script type="text/javascript">decorateList('compare-items')</script>
        <div class="actions">
            <a href="<?php echo $this->helper('catalog/product_compare')->getClearListUrl() ?>" onclick="return confirm('<?php echo $this->__('Are you sure you would like to remove all products from your comparison?') ?>');"><?php echo $this->__('Clear All') ?></a>
            <button class="button" onclick="popWin('<?php echo $this->helper('catalog/product_compare')->getListUrl() ?>','compare','top:50,left:50,width=800,height=600,resizable=yes,scrollbars=yes')"><span><?php echo $this->__('Compare Items') ?></span></button>
        </div>
    <?php else: ?>
        <p><?php echo $this->__('You have no items to compare.') ?></p>
    <?php endif; ?>
    </div>
</div>
